home *** CD-ROM | disk | FTP | other *** search
/ HamCall (April 1991) / HAMCALL CD-ROM (Buckmaster)(April 1991).BIN / prgming / ctutor / special.c < prev    next >
Text File  |  1990-10-14  |  1KB  |  48 lines

  1.                                         /* Chapter 9 - Program 7 */
  2. #include "stdio.h"
  3.  
  4. main()
  5. {
  6. int index;
  7.  
  8.    for (index = 0;index < 6;index++) {
  9.       printf("This line goes to the standard output.\n");
  10.       fprintf(stderr,"This line goes to the error device.\n");
  11.    }
  12.  
  13.    exit(4);  /* This can be tested with the DOS errorlevel
  14.                 command in a batch file. The number returned
  15.                 is used as follows;
  16.  
  17.                 IF ERRORLEVEL 4 GOTO FOUR
  18.                 (continue here if less than 4)
  19.                 .
  20.                 .
  21.                 GOTO DONE
  22.                 :FOUR
  23.                 (continue here if 4 or greater)
  24.                 .
  25.                 .
  26.                 :DONE
  27.                                                                   */
  28. }
  29.  
  30.  
  31.  
  32. /* Result of execution (without redirection)
  33.  
  34. This line goes to the standard output.
  35. This line goes to the error device.
  36. This line goes to the standard output.
  37. This line goes to the error device.
  38. This line goes to the standard output.
  39. This line goes to the error device.
  40. This line goes to the standard output.
  41. This line goes to the error device.
  42. This line goes to the standard output.
  43. This line goes to the error device.
  44. This line goes to the standard output.
  45. This line goes to the error device.
  46.  
  47. */
  48.